//
//  LcTimerRepeat.h
//  18Birdies
//
//  Created by weihua on 2017/3/16.
//  Copyright © 2017年 Lc. All rights reserved.
//

#import <Foundation/Foundation.h>

@class LcTimerRepeat;
typedef void (^TimerRepeatBlock)(LcTimerRepeat* timer);

@interface LcTimerRepeat : NSObject

@property(nonatomic, copy) NSString* name;
@property(nonatomic, strong) id userInfo;
@property(nonatomic, assign, readonly) BOOL running;

+ (dispatch_queue_t)uniqueQueue;
+ (instancetype)timerWithInterval:(NSTimeInterval)intervalTime block:(TimerRepeatBlock)block;

+ (instancetype)timerWithInterval:(NSTimeInterval)intervalTime
                        startTime:(NSTimeInterval)startTime
                            block:(TimerRepeatBlock)block;

+ (instancetype)timerWithInterval:(NSTimeInterval)intervalTime
                        startTime:(NSTimeInterval)startTime
                            block:(TimerRepeatBlock)block
                            queue:(dispatch_queue_t)queue;

- (instancetype)initWithWithInterval:(NSTimeInterval)intervalTime
                           startTime:(NSTimeInterval)startTime
                               block:(TimerRepeatBlock)block
                               queue:(dispatch_queue_t)queue;
- (void)start;
- (void)resume;
- (void)suspend;
- (void)stop;

@end
